with open("text.txt",mode="r",encoding="UTF-8") as f:
    res=f.read()
    str_list=res.split("\n")
    count=0
    for i in str_list:
        count += 1
    print(f"总行数:{count}")